﻿using HalconDotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace AIVision.Inspect.Camera
{
    public abstract class BaseCamera
    {
        public HObject MyImage { get; set; }
        public string CamerName { get; set; }
        public abstract List<string> FindCamer();//查找相机
        public abstract bool OpenCamerForCallBack(string CamerName);//根据相机序列号开启相机
        public abstract bool OpenCamer(string CamerName);//根据相机序列号开启相机
        public abstract bool CloseCamer();//关闭相机
        public abstract bool OneGrapForCallBack();//软触发一次-回调
        public abstract HObject OneGrap();//软触发一次
        public abstract bool EncoderGrap();//启动为硬触发
        public abstract bool ReconnectCamer(string CamerName);//重连相机
        public abstract bool SetExposureTime(int ExposureTime);//设置曝光


        //图像委托事件，用于传出参数
        public delegate void delegateProcessHImage(HObject Image,string camerName);
        public event delegateProcessHImage EventProcessImage;
        //调用图像函数，用于在转换图像格式后将图像传出
        public void GetImage(HObject getimage)
        {
            MyImage = new HObject(getimage);
            EventProcessImage(MyImage, CamerName);
        }
    }
}
